﻿<%@ Page Title="Programmatic creation" Language="C#" MasterPageFile="~/Demo.master"
    Inherits="DemoPage" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        DNA.UI.JQuery.Sortable sortable = DNA.UI.JQuery.Sortable.ApplyTo(SortableSimpleListView);
        DataBind();
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all" style="margin-bottom: 10px;">
        Sortable can apply to more than one WebControls and Html Elements dynaimic on server
        side of using <b>ApplyTo</b> Method. This is a simple way to apply Sortable to
        a control or controls.
    </div>
    <div class="dna-code">
        <demo:Code runat="server" ID="codeView" Language="c#" ShowLines="true">
            <CodeTemplate>protected void Page_Load(object sender, EventArgs e)
{
        DNA.UI.JQuery.Sortable sortable = DNA.UI.JQuery.Sortable.ApplyTo(SortableSimpleListView);
        DataBind();
}</CodeTemplate>
        </demo:Code>
    </div>
    <style type="text/css">
        .sortable { list-style-type: none; margin: 0; padding: 0; padding-top: 3px; width: 60%; }
        .sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 9pt; height: 18px; }
        .sortable li span { position: absolute; margin-left: -1.3em; }
    </style>
    <DotNetAge:SimpleListView ID="SortableSimpleListView" runat="server" CssClass="ui-helper-reset ui-widget-content sortable ui-corner-all"
        ItemCssClass="ui-helper-reset ui-state-default ui-corner-all" DataSourceID="XmlSortableListDataSource">
        <ItemTemplate>
            <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
            <%# Eval("Text") %>
        </ItemTemplate>
    </DotNetAge:SimpleListView>
    <asp:XmlDataSource ID="XmlSortableListDataSource" runat="server" DataFile="~/Sortable/sortable.xml"
        XPath="items/item"></asp:XmlDataSource>
</asp:Content>
